
[dbo].[OrderSuperProductAttributeLookup]
CREATE TABLE [dbo].[OrderSuperProductAttributeLookup]
(
[OrderProductID] [int] NOT NULL,
[OrderSuperProductAttributeID] [int] NOT NULL,
[SortOrder] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderSuperProductAttributeLookup] ADD CONSTRAINT [PK_OrderSuperProductAttributeLookup] PRIMARY KEY CLUSTERED ([OrderProductID], [OrderSuperProductAttributeID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[OrderSuperProductAttributeLookup] ADD CONSTRAINT [FK_OrderSuperProductAttributeLookup_OrderProduct] FOREIGN KEY ([OrderProductID]) REFERENCES [dbo].[OrderProduct] ([OrderProductID]) ON DELETE CASCADE ON UPDATE CASCADE
GO
ALTER TABLE [dbo].[OrderSuperProductAttributeLookup] ADD CONSTRAINT [FK_OrderSuperProductAttributeLookup_OrderSuperProductAttribute] FOREIGN KEY ([OrderSuperProductAttributeID]) REFERENCES [dbo].[OrderSuperProductAttribute] ([OrderSuperProductAttributeID])
GO